Usage
## nodes
mb(x, node)
nbr(x, node)
parents(x, node)
parents(x, node, debug = FALSE) <- value
children(x, node)
children(x, node, debug = FALSE) <- value
in.degree(x, node)
out.degree(x, node)
# degree(x, node)
root.nodes(x)
leaf.nodes(x)## arcs
arcs(x)
arcs(x, ignore.cycles = FALSE, debug = FALSE) <- value
directed.arcs(x)
undirected.arcs(x)
incoming.arcs(x, node)
outgoing.arcs(x, node)
incident.arcs(x, node)
compelled.arcs(x)
reversible.arcs(x)
narcs(x)
## adjacency matrix
amat(x)
amat(x, ignore.cycles = FALSE, debug = FALSE) <- value
## graphs
nparams(x, data, debug = FALSE)
ntests(x)
whitelist(x)
blacklist(x)
# shared with the graph package.
# these used to be a simple nodes(x) function.
## S3 method for class 'bn':
nodes(object)
## S3 method for class 'bn.fit':
nodes(object)
# these used to be a simple degree(x, node) function.
## S3 method for class 'bn':
degree(object, Nodes)
## S3 method for class 'bn.fit':
degree(object, Nodes)
Arguments
x,object
an object of class bn
or bn.fit
. The
replacement form of parents
, children
, arcs
and amat
require an object of class bn
.
node,Nodes
a character string, the label of a node.
value
either a vector of character strings (for parents
and
children
), an adjacency matrix (for amat
) or a data
frame with two columns (optionally labeled "from" and "to", for
arcs
).
data
a data frame containing the data the Bayesian network
was learned from. It's only needed if x
is an object of
class bn
.
ignore.cycles
a boolean value. If TRUE
the returned network
will not be checked for cycles.
debug
a boolean value. If TRUE
a lot of debugging output is
printed; otherwise the function is completely silent.